import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/gloable.css'
// @ts-ignore
import request from "@/utils/request";
// @ts-ignore
import store from './store'
import VueRouter from 'vue-router'
//Vue Router 解决重复导航路由url地址重复报错的问题
let originPush =VueRouter.prototype.push;
let originReplace =VueRouter.prototype.replace;
// @ts-ignore
VueRouter.prototype.push=function(location,resolve,reject){
  if(resolve&&reject){
    originPush.call(this,location,resolve,reject)
  }else{
    originPush.call(this,location,()=>{},()=>{})
  }
}
// @ts-ignore
VueRouter.prototype.replace=function(location,resolve,reject) {
  if (resolve && reject) {
    originReplace.call(this, location, resolve, reject)
  } else {
    originReplace.call(this, location, () => {
    }, () => {
    })
  }
}

// main.js全局注册
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// use
Vue.use(mavonEditor)

Vue.config.productionTip = false
Vue.use(ElementUI, { size: "small" })
Vue.prototype.request=request
// Vue.prototype.store=store
new Vue({
  router,
  // @ts-ignore
  store,
  render: h => h(App)
}).$mount('#app')
